﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ChangePassword.aspx.cs" Inherits="JobSeeker_ChangePassword1" MasterPageFile="~/JobSeeker/JobSeekerMaster.master" %>

<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:LoginView ID="LoginView1" runat="server" Visible="false">
        <LoggedInTemplate>
            <asp:LoginName ID="LoginName1" runat="server" FormatString="You are logged in as {0}." />
            <br />
        </LoggedInTemplate>
        <AnonymousTemplate>
            You are not logged in
        </AnonymousTemplate>
    </asp:LoginView>
    <br />
    <asp:UpdatePanel runat="server" ID="upWholePage" EnableViewState="False">
        <ContentTemplate>
            <!--Body Container Start Here-->
            <div class="container">
                <div class="row top-margin">
                    <div class="panel-body">

                        <!--Manage Profile Start-->
                        <div class="row form-row">
                            <!--Form Start Here-->
                            <div class="row form-body">
                                <div class="col-md-8">
                                    <div class="form-horizontal manage-profile" role="form">
                                        <asp:ChangePassword ID="ChangePwd" runat="server" ContinueButtonType="Link" EnableViewState="False" 
                                            OnSendMailError="ChangePwd_SendMailError" NewPasswordRegularExpressionErrorMessage="Error: Your password must be at least 6 characters long"
                                            ChangePasswordFailureText="" ContinueDestinationPageUrl="~/Default.aspx">
                                            <ChangePasswordTemplate>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">Current Password<i>*</i></label>
                                                    <div class="col-md-4">
                                                        <asp:TextBox ID="CurrentPassword" CssClass="form-control" runat="server" TextMode="Password"  AutoCompleteType="Disabled" />
                                                        <asp:RequiredFieldValidator ID="reqCurrentPassword" runat="server" ControlToValidate="CurrentPassword" SetFocusOnError="true"
                                                            ErrorMessage="Old password is required." ToolTip="Old password is required." Display="Dynamic"
                                                            ValidationGroup="changePass"></asp:RequiredFieldValidator>
                                                        <asp:CustomValidator runat="server" Visible="true" ID="cusCurrentPass" ControlToValidate="CurrentPassword" Display="Dynamic" ForeColor="Red"
                                                            ErrorMessage="Incorrect current password" OnServerValidate="cusCurrentPass_ServerValidate"
                                                            ValidationGroup="changePass">
                                                        </asp:CustomValidator>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">New Password<i>*</i></label>
                                                    <div class="col-md-4">
                                                        <asp:TextBox ID="NewPassword" CssClass="form-control"   AutoCompleteType="Disabled"  runat="server" TextMode="Password" SetFocusOnError="true" />
                                                        <asp:RequiredFieldValidator ID="reqNewPassword" runat="server" ControlToValidate="NewPassword"
                                                            SetFocusOnError="True" ErrorMessage="New password is required." Display="Dynamic"
                                                            ToolTip="Old password is required." ValidationGroup="changePass"></asp:RequiredFieldValidator>
                                                        <asp:CustomValidator runat="server" ID="cusCustom" ControlToValidate="NewPassword" Display="None"
                                                            ErrorMessage="Password length must be 6 or more characters" OnServerValidate="cusCustom_ServerValidate"
                                                            ValidationGroup="changePass">
                                                        </asp:CustomValidator>
                                                        <ajax:PasswordStrength ID="PasswordStrength1" TargetControlID="NewPassword" StrengthIndicatorType="Text"
                                                            PrefixText="Strength:" HelpStatusLabelID="lblhelp" PreferredPasswordLength="8"
                                                            MinimumNumericCharacters="1" MinimumSymbolCharacters="1" TextStrengthDescriptions="Very Poor;Weak;Average;Good;Excellent"
                                                            StrengthStyles="VeryPoorStrength;WeakStrength;AverageStrength;GoodStrength;ExcellentStrength"
                                                            runat="server" />
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">Confirm Password<i>*</i></label>
                                                    <div class="col-md-4" style="color: red;">
                                                        <asp:TextBox ID="ConfirmNewPassword" CssClass="form-control"  AutoCompleteType="Disabled" runat="server" TextMode="Password" SetFocusOnError="true" />
                                                        <asp:RequiredFieldValidator Display="Dynamic" ID="reqConfirmNewPassword" runat="server"
                                                            ControlToValidate="ConfirmNewPassword" SetFocusOnError="True" ErrorMessage="Please re-enter password to confirm"
                                                            ToolTip="Confirm password is required." ValidationGroup="changePass"></asp:RequiredFieldValidator>
                                                        <asp:CompareValidator ID="cmvConfirmPwd" runat="server" ControlToCompare="NewPassword"
                                                            ControlToValidate="ConfirmNewPassword" ValidationGroup="changePass" Display="Dynamic"
                                                            ErrorMessage="Confirm password must be same as new password" ForeColor="Red" SetFocusOnError="True"></asp:CompareValidator>
                                                    </div>
                                                </div>
                                                <div class="form-group" style="margin-left: 25%;">
                                                    <asp:Literal ID="FailureText" runat="server" EnableViewState="False" />
                                                    <%--<asp:ValidationSummary ForeColor="Red" ID="valSumChangePass" runat="server" ShowSummary="true" ValidationGroup="changePass" />--%>
                                                </div>
                                            </ChangePasswordTemplate>
                                            <MailDefinition BodyFileName="~/JobSeeker/EmailTemplates/ChangePassword.htm" IsBodyHtml="True"
                                                Subject="Your password has been changed!" Priority="High">
                                            </MailDefinition>
                                        <%--    <SuccessTemplate>
                                                Password changed sucessfully!<br />
                                                <%--<asp:LinkButton ID="lnkContinue" Text="Continue" runat="server" PostBackUrl="~/Default.aspx"></asp:LinkButton>--%>
                                          <%--    </SuccessTemplate>--%>
                                        </asp:ChangePassword>
                                    </div>
                                </div>
                            </div>
                            <!--Form End Here-->
                        </div>
                        <!--Manage Profile Start-->

                        <!--Upload Resume Information Start Here-->
                        <div class="edit-profile-form">
                            <div class="row form-row">
                                <!--Form Start Here-->
                                <div class="row form-body submit">
                                    <div>
                                        <asp:Label ID="lblSaveMsg" runat="server" Font-Size="Medium" Font-Italic="true" Font-Bold="true" ForeColor="Green"></asp:Label>
                                        <asp:UpdateProgress ID="upProWholePage" DisplayAfter="10" runat="server" AssociatedUpdatePanelID="upWholePage">
                                            <ProgressTemplate>
                                                <div id="progressBackgroundFilter"></div>
                                                <div id="processMessage">
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <img alt="Loading..." src="/img/please_wait.gif" /></span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ProgressTemplate>
                                        </asp:UpdateProgress>
                                    </div>
                                    <div class=" col-md-4 pull-right text-right">
                                        <asp:Button ID="ChangePasswordPushButton" ValidationGroup="changePass" CommandName="ChangePassword" CssClass="btn btn-primary orange-gradiant float-shadow" runat="server" Text="Save" OnClick="ChangePasswordPushButton_Click" EnableViewState="False" />
                                    </div>
                                </div>
                                <!--Form End Here-->
                            </div>
                        </div>
                        <!--Upload Resume Information End Here-->

                    </div>
                </div>
            </div>
            <!--Body Container End Here-->
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
